/* This source file is part of the Delectable Engine.
 * For the latest info, please visit http://delectable.googlecode.com/
 *
 * Copyright (c) 2009-2010 Ryan Chew
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file KeyboardEvents.h
 * @brief Keyboard event defines.
 */

#ifndef __DBL_KEYBOARDEVENTS_H_
#define __DBL_KEYBOARDEVENTS_H_

// Chewable Headers //
#include <cbl/Chewable.h>
#include <cbl/Core/Event.h>

// Delectable Headers //
#include "dbl/Delectable.h"
#include "dbl/Input/KeyCodes.h"

namespace dbl
{
	namespace E
	{
		/*************************
		 *	[DEFINED EVENTS]
		 *	OnKeyDown
		 *	OnKeyUp
		 *	OnKeyClick
		 *	OnKeyChar
		 *************************/

		// Keyboard key down event.
		BEGIN_EVENT_DEF( OnKeyDown )
			/***** Event Arguments *****/
			Key::Code			KeyCode;
			cbl::Uint16			Modifiers;

			/***** Event Constructors *****/
			// OnKeyDown constructor.
			Constructor()
				: KeyCode( Key::Code( 0 ) ), Modifiers( 0 ) {}
			// OnKeyDown constructor.
			Constructor( Key::Code code, cbl::Uint16 modifiers )
				: KeyCode( code ), Modifiers( modifiers ) {}
		END_EVENT_DEF

		// Keyboard key up event.
		BEGIN_EVENT_DEF( OnKeyUp )
			/***** Event Arguments *****/
			Key::Code			KeyCode;
			cbl::Uint16			Modifiers;

			/***** Event Constructors *****/
			// OnKeyUp constructor.
			Constructor()
				: KeyCode( Key::Code( 0 ) ), Modifiers( 0 ) {}
			// OnKeyUp constructor.
			Constructor( Key::Code code, cbl::Uint16 modifiers )
				: KeyCode( code ), Modifiers( modifiers ) {}
		END_EVENT_DEF

		// Keyboard key click event.
		BEGIN_EVENT_DEF( OnKeyClick )
			/***** Event Arguments *****/
			Key::Code			KeyCode;
			cbl::Uint16			Modifiers;

			/***** Event Constructors *****/
			// OnKeyClick constructor.
			Constructor()
				: KeyCode( Key::Code( 0 ) ), Modifiers( 0 ) {}
			// OnKeyClick constructor.
			Constructor( Key::Code code, cbl::Uint16 modifiers )
				: KeyCode( code ), Modifiers( modifiers ) {}
		END_EVENT_DEF
						
		// Key character event.
		BEGIN_EVENT_DEF( OnKeyChar )
			/***** Event Arguments *****/
			cbl::Uint32	Unicode;

			/***** Event Constructors *****/
			// OnWindowKeyChar constructor.
			Constructor( cbl::Uint32 code = 0 )
				: Unicode( code ) {}
		END_EVENT_DEF
	}
}

#endif // __DBL_KEYBOARDEVENTS_H_
